//
//  NEDBaseCollectionViewController.m
//  MoreCoin
//
//  Created by 林宁宁 on 2019/11/15.
//  Copyright © 2019 MoreCoin. All rights reserved.
//

#import "NEDBaseCollectionViewController.h"
#import <Masonry/Masonry.h>

@interface NEDBaseCollectionViewController ()

@end

@implementation NEDBaseCollectionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UICollectionViewFlowLayout * flowLayout = [UICollectionViewFlowLayout new];
    
    self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
    self.collectionView.delegate = self;
    self.collectionView.dataSource = self;
    self.collectionView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.collectionView];
    [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
    [self.collectionView registerClass:NEDCollectionViewCell.class forCellWithReuseIdentifier:[NEDCollectionViewCell cellIndentify]];
    self.dataList = [NSMutableArray new];
}

-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
    return 1;
}

-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return self.dataList.count;
}

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    NEDCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:[NEDCollectionViewCell cellIndentify] forIndexPath:indexPath];
    
    
    return cell;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
